package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.common.utils.UUIDUtils;
import com.education.wisdom.mapper.MscommentsMapper;
import com.education.wisdom.pojo.Mscomments;
import com.education.wisdom.service.MscommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 课后评价 服务层实现
 * 
 * @author ruoyi
 * @date 2018-12-17
 */
@Service
public class MscommentsServiceImpl implements MscommentsService
{
	@Autowired
	private MscommentsMapper mscommentsMapper;

	/**
     * 查询课后评价信息
     * 
     * @param plId 课后评价ID
     * @return 课后评价信息
     */
    @Override
	public Mscomments selectMscommentsById(String plId)
	{
	    return mscommentsMapper.selectMscommentsById(plId);
	}
	
	/**
     * 查询课后评价列表
     * 
     * @param mscomments 课后评价信息
     * @return 课后评价集合
     */
	@Override
	public List<Mscomments> selectMscommentsList(Mscomments mscomments)
	{
	    return mscommentsMapper.selectMscommentsList(mscomments);
	}
	
    /**
     * 新增课后评价
     * 
     * @param mscomments 课后评价信息
     * @return 结果
     */
	@Override
	public int insertMscomments(Mscomments mscomments)
	{
		mscomments.setPlCreatetime(new Date());
		mscomments.setPlId(UUIDUtils.getByUUId());
	    return mscommentsMapper.insertMscomments(mscomments);
	}
	
	/**
     * 修改课后评价
     * 
     * @param mscomments 课后评价信息
     * @return 结果
     */
	@Override
	public int updateMscomments(Mscomments mscomments)
	{
	    return mscommentsMapper.updateMscomments(mscomments);
	}

	/**
     * 删除课后评价对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteMscommentsByIds(String ids)
	{
		return mscommentsMapper.deleteMscommentsByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Mscomments> selectmystudentList(Map<String, Object> map) {
		return mscommentsMapper.selectmystudentList(map);
	}
	
}
